package nz.ac.massey.jfontview;

import java.awt.Font;

/**
 * A modifiable font.
 * @author Nathan C Jones
 * @version 1.0
 */
public interface MutableFont {
	
	/**
	 * Set the state of the mutable font to match the given font.
	 * @param font the font to model the state of the mutable font from.
	 * @see java.awt.Font
	 */
	public void setFont(Font font);
	
	/**
	 * Get the font currently represented by the state of the mutable font.
	 * @return the font represented by the mutable font.
	 * @see java.awt.Font
	 */
	public Font getFont();
	
	/**
	 * Set the style of the mutable font.
	 * @param style the new style.
	 * The style can be one of:
	 * <ul>
	 * 	<li>Font.PLAIN</li>
	 * 	<li>Font.BOLD</li>
	 * 	<li>Font.ITALIC</li>
	 * 	<li>Font.BOLD|Font.ITALIC</li>
	 * </ul>
	 * @see java.awt.Font
	 */
	public void setStyle(int style);
	
	/**
	 * Get the current style of the mutable font.
	 * @return the current style of the font.
	 * Should be one of:
	 * <ul>
	 * 	<li>Font.PLAIN</li>
	 * 	<li>Font.BOLD</li>
	 * 	<li>Font.ITALIC</li>
	 * 	<li>Font.BOLD|Font.ITALIC</li>
	 * </ul>
	 * @see java.awt.Font.getStyle()
	 */
	public int getStyle();
	
	/**
	 * Set the size of the mutable font.
	 * @param size the new size.
	 * @see java.awt.Font
	 */
	public void setSize(int size);
	
	/**
	 * Get the current size of the mutable font.
	 * @return the current size of the font.
	 * @see java.awt.Font.getSize()
	 */
	public int getSize();
	
	/**
	 * Set the name of the font - the font face.
	 * @param name the name of the new font face.
	 * @see java.awt.Font
	 */
	public void setName(String name);
	
	/**
	 * Get the name of the font face of the mutable font. 
	 * @return the current font face name.
	 */
	public String getName();
	
	/**
	 * Register a mutable font listener with the mutable font.
	 * @param listener the mutable font listener to be added.
	 */
	public void addMutableFontListener(MutableFontListener listener);
	
	/**
	 * De-register a mutable font listener with the mutable font.
	 * @param listener the mutable font listener to be removed.
	 */
	public void removeMutableFontListener(MutableFontListener listener);
	
	/**
	 * Notify all mutable font observers that the font has been updated.
	 */
	public void fireFontChanged();

}
